<%-- 
    Document   : foro
    Created on : 13-dic-2011, 9:32:37
    Author     : Pashi
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="/VirtualBook/css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <title>Foro  </title>
    </head>
    <body>
        <div id="header">
            <div id="menu">
              <ul>
             <li><a href="#"><strong>Estudiante</strong></a></li>
             <li><a href="#">Inicio</a></li>
              <li><a href="registrarSolicitudLibro.jsp">Compartir Libro</a></li>
              <li><a href="searchBook.jsp">Buscar Libro</a></li>
             

             </ul>
                
                </div>
            
	<!-- end #menu -->
</div>
<!-- end #header -->
<!-- end #header-wrapper -->
<div id="logo">
	<h1><a>Virtual</a></h1>
	<p><em>Book</em></p>
</div>
<hr />
<!-- end #logo -->
<div id="page">
	<div id="content">
		<div id="content-bgtop">
                    
                    <div id="content-bgbtm">
                    
                    </div>
		</div>
	
          <s:property value="#session['user.username']"/>
     <s:text name="bienvenidaForo"></s:text>
        
      <s:if test="(questionsBean.isEmpty())">
            <s:text name="vacio"/>
            <s:url action="askForumMgmt" var="linkPreguntas"></s:url>
	<p><a href="${linkPreguntas}">Se el primero en preguntar!</a></p>
      </s:if>
      <s:else>
           <table>		
                <s:iterator value="questionsBean" >  
                    <tr><td>
                            <s:property value="question"/></td><td><a href="<s:url action='deleteQForumMgmt'>                                        
                            <s:param name="idQ" value="idquestion"/></s:url>" >Eliminar</a>
                        </td>
                        <td><table>
                        <s:iterator value="arrayAnswers" >
                        <tr><td> <s:property value="answer"/></td><td><a href="<s:url action='deleteAForumMgmt'>
                            <s:param name="idA" value="idanswer"/>
                            <s:param name="idQ" value="idquestion"/></s:url>" >Eliminar</a>
                        </td></tr>
                        </s:iterator></table>
                        <a href="<s:url action='answerForumMgmt'><s:param name="idQ" value="idquestion"/></s:url>"><s:text name="botonResponder" /></a></td>
            </s:iterator>
            </table>
            <p>
            <s:url action="askForumMgmt" var="linkPreguntas"></s:url>
            <p><a href="${linkPreguntas}">Preguntar</a></p>	
            </p>
        </s:else>
        
        </div>
	<!-- end #content -->
	<div style="clear: both;">&nbsp;</div>
	<!-- end #page -->
	<div id="footer">

	</div>
	<!-- end #footer -->
</div>
    </body>
</html>
